/*
 * @Author: Dagon
 * @Date: 2021-03-02 15:18:16
 * @Description: 通过原型实现继承
 */
  
 function Animal(name) {
   this.name = name
 }

 Animal.prototype.eat = function () {
   console.log(`${this.name} eating`)
 }

 function Cat(furColor, name) {
   this.furColor = furColor
   this.name = name
 }

 // 继承类
 Cat.prototype = new Animal() // 子实例等于父类的实例

 const cat1 = new Cat('white', 'xiaohua')
 cat1.eat()